package com.vhall.component.entity.dictionary.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author shimingming
 * @since 2023/4/14 10:31
 */
@Getter
@AllArgsConstructor
public enum AdTypeEnum implements BaseEnum {

    DIRECT_SEEDING(0, "直播"),
    JUMP_TO_OUTER_CHAIN(1, "跳转外链");

    private Integer value;

    private String name;

    public static String getName(Integer value) {
        for (AdTypeEnum template : AdTypeEnum.values()) {
            if (template.getValue().equals(value)) {
                return template.name;
            }
        }
        return null;
    }

    public static AdTypeEnum parse(Integer value) {
        for (AdTypeEnum type : AdTypeEnum.values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        return null;
    }

}
